Setup Library & Data
library(readr)
library(ggplot2)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(gridExtra)
##
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
##
## combine
library(tidyr)
library(broom)
ref_values_files <- list.files(path = ".", pattern = "^ref.*\\.csv$", full.names = FALSE)
variation_f_files <- list.files(path = ".", pattern = "^var.*\\.csv$", full.names = FALSE)
ls_ref <- lapply(ref_values_files, function(p){readr::read_csv(p)})
## Rows: 8 Columns: 5
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): symbol, units, description
## dbl (2): min, max
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## Rows: 8 Columns: 5
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): symbol, units, description
## dbl (2): min, max
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## Rows: 10 Columns: 5
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): symbol, units, description
## dbl (2): min, max
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## Rows: 8 Columns: 5
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): symbol, units, description
## dbl (2): min, max
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## Rows: 10 Columns: 5
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): symbol, units, description
## dbl (2): min, max
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## Rows: 12 Columns: 5
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): symbol, units, description
## dbl (2): min, max
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## Rows: 9 Columns: 5
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): symbol, units, description
## dbl (2): min, max
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## Rows: 10 Columns: 5
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): symbol, units, description
## dbl (2): min, max
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## Rows: 8 Columns: 5
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): symbol, units, description
## dbl (2): min, max
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
names(ls_ref) <- lapply(ref_values_files, function(n){sub(".* - (.*?)\\..*", "\\1", n)})
ls_var <- lapply(variation_f_files, function(p){
readr::read_csv(p, col_types = cols(prd = col_double(), data = col_double()))
})
names(ls_var) <- lapply(variation_f_files, function(n){sub(".* - (.*?)\\..*", "\\1", n)})
names(ls_var) == names(ls_ref)
## [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
Perdix perdix
name = "Perdix_perdix"
unique(ls_var[[name]]$description)
## [1] "age at birth"
## [2] "time since birth at fledging"
## [3] "time since birth at puberty"
## [4] "time since birth at first reproduction"
## [5] "life span"
## [6] "initial wet weight"
## [7] "wet weight at birth"
## [8] "ultimate wet weight"
## [9] "ultimate wet weight for males"
## [10] "maximum reprod rate"
unique(ls_var[[name]]$symbol)
## [1] "ab" "tx" "tp" "tR" "am" "Ww0" "Wwb" "Wwi" "Wwim" "Ri"
varNames = list(
'1'="age at birth, ab",
'2'="time since birth at fledging, tx",
'3'="time since birth at puberty, tp",
'4'="time since birth at first reproduction, tR",
'5'="life span, am",
'6'="initial wet weight, Ww0",
'7'="wet weight at birth, Wwb",
'8'="ultimate wet weight, Wwi",
'9'="ultimate wet weight for males, Wwim",
'10'="maximum reprod rate, Ri"
)
ls_p = plts(name, varNames)
## Joining with `by = join_by(symbol, units, description)`
ls_p[[1]]
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

# gridExtra::grid.arrange(g1,g2)
ls_p[[2]]

Motacilla_flava
name = "Motacilla_flava"
unique(ls_var[[name]]$description)
## [1] "age at birth" "time since birth at fledging"
## [3] "time since birth at puberty" "time since birth at 1st brood"
## [5] "life span" "wet weight at birth"
## [7] "ultimate wet weight" "maximum reprod rate"
unique(ls_var[[name]]$symbol)
## [1] "ab" "tx" "tp" "tR" "am" "Wwb" "Wwi" "Ri"
varNames = list(
'1'="age at birth, ab",
'2'="time since birth at fledging, tx",
'3'="time since birth at puberty, tp",
'4'="time since birth at 1st brood, tR",
'5'="life span, am",
'6'="wet weight at birth, Wwb",
'7'="ultimate wet weight, Wwi",
'8'="maximum reprod rate, Ri"
)
ls_p = plts(name, varNames)
## Joining with `by = join_by(symbol, units, description)`
ls_p[[1]]
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

# gridExtra::grid.arrange(g1,g2)
ls_p[[2]]

Alauda arvensis
name = "Alauda_arvensis"
unique(ls_var[[name]]$description)
## [1] "age at birth" "time since birth at fledging"
## [3] "time since birth at puberty" "time since birth at 1st brood"
## [5] "life span" "wet weight at birth"
## [7] "ultimate wet weight" "maximum reprod rate"
unique(ls_var[[name]]$symbol)
## [1] "ab" "tx" "tp" "tR" "am" "Wwb" "Wwi" "Ri"
varNames = list(
'1'="age at birth, ab",
'2'="time since birth at fledging, tx",
'3'="time since birth at puberty, tp",
'4'="time since birth at 1st brood, tR",
'5'="life span, am",
'6'="wet weight at birth, Wwb",
'7'="ultimate wet weight, Wwi",
'8'="maximum reprod rate, Ri"
)
ls_p = plts(name, varNames)
## Joining with `by = join_by(symbol, units, description)`
ls_p[[1]]
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

# gridExtra::grid.arrange(g1,g2)
ls_p[[2]]

Turdus_philomelos
name = "Turdus_philomelos"
unique(ls_var[[name]]$description)
## [1] "age at birth" "time since birth at fledging"
## [3] "time since birth at puberty" "time since birth at 1st brood"
## [5] "life span" "wet weight at birth"
## [7] "ultimate wet weight for female" "maximum reprod rate"
unique(ls_var[[name]]$symbol)
## [1] "ab" "tx" "tp" "tR" "am" "Wwb" "Wwi" "Ri"
varNames = list(
'1'="age at birth, ab",
'2'="time since birth at fledging, tx",
'3'="time since birth at puberty, tp",
'4'="time since birth at 1st brood, tR",
'5'="life span, am",
'6'="wet weight at birth, Wwb",
'7'="ultimate wet weight, Wwi",
'8'="maximum reprod rate, Ri"
)
ls_p = plts(name, varNames)
## Joining with `by = join_by(symbol, units, description)`
ls_p[[1]]
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

# gridExtra::grid.arrange(g1,g2)
ls_p[[2]]

Sorex_araneus
name = "Sorex_araneus"
unique(ls_var[[name]]$description)
## [1] "gestation time" "time since birth at weaning"
## [3] "time since birth at puberty" "life span"
## [5] "ultimate total length" "wet weight at birth"
## [7] "wet weight at weaning" "wet weight at puberty"
## [9] "ultimate wet weight" "maximum reprod rate"
unique(ls_var[[name]]$symbol)
## [1] "tg" "tx" "tp" "am" "Li" "Wwb" "Wwx" "Wwp" "Wwi" "Ri"
varNames = list(
'1'="gestation time, tg",
'2'="time since birth at weaning, tx",
'3'="time since birth at puberty, tp",
'5'="life span, am",
'6'="ultimate total length, Li",
'7'="wet weight at birth, Wwb",
'8'="wet weight at weaning, Wwx",
'9'="wet weight at puberty, Wwp",
'10'="ultimate wet weight, Wwi",
'11'="maximum reprod rate, Ri"
)
ls_p = plts(name, varNames)
## Joining with `by = join_by(symbol, units, description)`
ls_p[[1]]
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

# gridExtra::grid.arrange(g1,g2)
ls_p[[2]]

Crocidura_russula
name = "Crocidura_russula"
unique(ls_var[[name]]$description)
## [1] "gestation time" "time since birth at weaning"
## [3] "time since birth at puberty" "life span"
## [5] "wet weight at birth" "wet weight at weaning"
## [7] "ultimate wet weight" "maximum reprod rate"
unique(ls_var[[name]]$symbol)
## [1] "tg" "tx" "tp" "am" "Wwb" "Wwx" "Wwi" "Ri"
varNames = list(
'1'="gestation time, tg",
'2'="time since birth at weaning, tx",
'3'="time since birth at puberty, tp",
'5'="life span, am",
'6'="wet weight at birth, Wwb",
'7'="wet weight at weaning, Wwx",
'8'="ultimate wet weight, Wwi",
'9'="maximum reprod rate, Ri"
)
ls_p = plts(name, varNames)
## Joining with `by = join_by(symbol, units, description)`
ls_p[[1]]

# gridExtra::grid.arrange(g1,g2)
ls_p[[2]]

Ichthyosaura_alpestris
name = "Ichthyosaura_alpestris"
unique(ls_var[[name]]$description)
## [1] "life span" "SVL at metam for females"
## [3] "SVL at puberty for females" "SVL at puberty for males"
## [5] "ultimate SVL for females" "ultimate SVL for males"
## [7] "wet weight at birth" "ultimate wet weight for females"
## [9] "ultimate wet weight for males" "maximum reprod rate"
unique(ls_var[[name]]$symbol)
## [1] "am" "Lj" "Lp" "Lpm" "Li" "Lim" "Wwb" "Wwi" "Wwim" "Ri"
varNames = list(
'1'="life span, am",
'2'="SVL at metam for females, Lj",
'3'="SVL at puberty for females, Lp",
'4'="SVL at puberty for males, Lpm",
'5'="ultimate SVL for females, Li",
'6'="ultimate SVL for males, Lim",
'7'="wet weight at birth, Wwb",
'8'="ultimate wet weight for females, Wwi",
'9'="ultimate wet weight for males, Wwim",
'10'="maximum reprod rate, Ri"
)
ls_p = plts(name, varNames)
## Joining with `by = join_by(symbol, units, description)`
ls_p[[1]]
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning: Removed 2 rows containing missing values or values outside the scale range
## (`geom_point()`).

# gridExtra::grid.arrange(g1,g2)
ls_p[[2]]
## Warning: Removed 2 rows containing non-finite outside the scale range (`stat_smooth()`).
## Removed 2 rows containing non-finite outside the scale range (`stat_smooth()`).
## Warning: Removed 2 rows containing missing values or values outside the scale range
## (`geom_point()`).

Rana_temporaria
name = "Rana_temporaria"
unique(ls_var[[name]]$description)
## [1] "age at birth" "time since birth at metam"
## [3] "time since metam at puberty" "life span"
## [5] "body length at metam" "ultimate body length"
## [7] "wet weight at birth" "ultimate wet weight"
## [9] "maximum reprod rate"
unique(ls_var[[name]]$symbol)
## [1] "ab" "tj" "tp" "am" "Lj" "Li" "Wwb" "Wwi" "Ri"
varNames = list(
'1'="age at birth, ab",
'2'="time since birth at metam, tj",
'3'="time since metam at puberty, tp",
'4'="life span, am",
'5'="body length at metam, Lj",
'6'="ultimate body length, Li",
'7'="wet weight at birth, Wwb",
'8'="ultimate wet weight, Wwi",
'9'="maximum reprod rate, Ri"
)
ls_p = plts(name, varNames)
## Joining with `by = join_by(symbol, units, description)`
ls_p[[1]]
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

# gridExtra::grid.arrange(g1,g2)
ls_p[[2]]

Podarcis_muralis
name = "Podarcis_muralis"
unique(ls_var[[name]]$description)
## [1] "time since birth at puberty" "life span"
## [3] "SVL at hatching" "SVL at puberty for females"
## [5] "SVL at puberty for males" "ultimate SVL for females"
## [7] "ultimate SVL for males" "wet weight of eggs"
## [9] "wet weight of hatchlings" "ultimate wet weight"
## [11] "ultimate wet weight for males" "maximum reprod rate"
unique(ls_var[[name]]$symbol)
## [1] "tp" "am" "Lb" "Lp" "Lpm" "Li" "Lim" "Ww0" "Wwb" "Wwi"
## [11] "Wwim" "Ri"
varNames = list(
'1'="time since birth at puberty, tp",
'2'="life span, am",
'3'="SVL at hatching, Lb",
'4'="SVL at puberty for females, Lp",
'5'="SVL at puberty for males, Lpm",
'6'="ultimate SVL for females, Li",
'7'="ultimate SVL for males, Lim",
'8'="wet weight of eggs, Ww0",
'9'="wet weight of hatchlings, Wwb",
'10'="ultimate wet weight, Wwi",
'11'="ultimate wet weight for males, Wwim",
'12'="maximum reprod rate, Ri"
)
ls_p = plts(name, varNames)
## Joining with `by = join_by(symbol, units, description)`
ls_p[[1]]
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

# gridExtra::grid.arrange(g1,g2)
ls_p[[2]]
